<h1>发布文章</h1>

<?php echo View::format_errors($warning, $errors); ?>

<script src="/MVC/3rdparty/ckeditor/ckeditor.js"></script>

<!-- 采用 CKEDITOR 作为编辑器 -->
<form action="/MVC/post" method="POST">
	<p><label>标题：
		<input type="text" name="title" size="70" class="posttitle" value="<?php echo $old_title; ?>" />
	</label></p>
	<p><label>类别：
		<select name="category">
			<?php for($i = 0; $i != count($category_names); ++$i): ?>
				<option value="<?php echo $category_ids[$i].'"'; 
					if ($i == $old_category) {
							echo ' selected="selected"';
					}
				?>>
					<?php echo $category_names[$i];?>
				</option>
			<?php endfor; ?>
		</select>
	</label></p>
    <textarea id="ckeditor" height="350" name="post_content"><?php echo $old_content; ?></textarea>
	<input type="submit" name="submit" class="submit" value="提交">
	
	<script type="text/javascript">
		CKEDITOR.replace('ckeditor', {
			height: 300,
			contentsCss: '/MVC/css/editor.css'
		});
	</script>
</form>
